<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>测试发出post请求</h1>
<form action="">
    <input type="text" name="info">
    <input type="button" value="发出请求" onclick="fn()">
</form>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script>
    function fn() {
        //创建一个
        let data =new FormData(document.querySelector("form"));
        //发出异步post请求
        axios.post("/test02",data).then(function (response) {
            alert(response.data);//弹出服务器返回的内容
        })
    }
</script>

</body>
</html>